<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DEMO目录</title>
    <style>
        *{margin: 0;padding: 0}
        .container {
        }
        .container a {
            display: flex;
            height: 30px;
            margin: 5px 0;
            padding: 0 15px;
        }
        .container .menu-item {
            width: 100%;
            display: flex;
            /*justify-content: center;*/
            align-items: center;
            /*background-color: #b3d4fc;*/
        }
    </style>
</head>
<body>
<div class="container">
    <a href="./ios-vh.html"><div class="menu-item">高度100vh</div></a>
    <a href="./ios.html"><div class="menu-item">高度100%</div></a>
    <a href="./image.html"><div class="menu-item">图片css效果</div></a>
    <a href="./getDate.html"><div class="menu-item">日期时间处理</div></a>
    <a href="./debounce.html"><div class="menu-item">节流防抖</div></a>
    <a href="./rewrite.html"><div class="menu-item">静态资源rewrite</div></a>
    <a href="./flower.html"><div class="menu-item">樱花特效</div></a>
</div>
<script>

    function test() {
        let list = [
            {id:1, name: '1'},
            {id:2, name: '2'},
            {id:3, name: '3'},
            {id:4, name: '4'},
            {id:5, name: '5'},
        ]
        // 循环删除数组元素, 倒着循环删可以, 切忌正循环删除
        // for(let i=list.length-1; i>=0; i--) {
        //     if([3,4].indexOf(list[i].id) !== -1) {
        //         list.splice(i,1)
        //     }
        // }

        // 效果同上
        let res = list.filter(item => {
            return [3,4].indexOf(item.id) === -1
        })
        console.log("list = ", res)
    }

    test()


    // let res = list2.filter(item => {
    //     return [7,8].indexOf(item) === -1
    // })


    // 1,7,8,2,4,5,9,11,12
    //执行顺序结果： 微任务promise、主线程console、微任务then、宏任务setTimeout
</script>
</body>
</html>